package SHI;
$Mojo::Webqq::Plugin::SHI::PRIORITY = 1;
use Encode;

my $shidb='SHIFD';
open my $SFD,"<",$shidb or warn "file @!";
my @shi=<$SFD>;
close $SFD;
my $shidb ;
$shidb .=$_ for @shi;
my @shi300= split /\n\n/sm,$shidb;
sub call {
    my $client = shift;
    $client->on(receive_message=>sub{
        my($client,$msg)=@_;
        return if not $msg->allow_plugin;
         return if $msg->content !~ /(诗\s*经|诗\s*三百|无\s*邪|无\s*鞋)/;
          my $shiwen = $shi300[int rand($#shi300+1)];
          my @shici=split /\n/sm, $shiwen;
          my $reply;
          for(@shici){
            next if /^\s*$/;
            $reply .=$_."\n";
            }
           $reply .="(源于Mojo-Webqq桔子诗经机器人插件)";
           $msg->reply($reply,sub{$_[1]->from("bot")}) if $reply;
#        $client->reply_message($msg,$reply,sub{$_[1]->msg_from("bot")}) if $reply;
    });
}
1;
=cut
